package zisu.netty.practice.RPC.config;

import org.springframework.util.StringUtils;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * @Desc: "这个顶层的抽象类 会放一些公共的东西 "
 * @Author: caixiang
 * @DATE: 2021/1/20 15:15
 */
public abstract class RpcConfigAbstract {

    private AtomicInteger generator = new AtomicInteger(0);

    protected String id;

    protected String interfaceClass = null;


    //服务的调用方（consumer端特有属性）
    protected Class<?> proxyClass = null;

    public String getId() {
        if(StringUtils.isEmpty(id)){
            id = "rapid-cfg-gen-"+generator.getAndIncrement();
        }
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getInterface() {
        return interfaceClass;
    }

    public void setInterfaceClass(String interfaceClass) {
        this.interfaceClass = interfaceClass;
    }




}